package com.sh.common.enums;

/**
 * @author luotao
 */

public enum ValueTypeEnum {

    INT("int", "int"),
    LONG("long", "long"),
    FLOAT("float", "float"),
    COMPLEX("complex", "complex"),
    STR("str", "str"),
    BOOL("bool", "bool"),
    LIST("list", "list"),
    DICT("dict", "dict"),
    SET("set", "set"),
    TUPLE("tuple", "tuple");


    private String code;
    private String message;

    ValueTypeEnum(String code, String message){
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code) {
        for (ValueTypeEnum usedEnum : ValueTypeEnum.values()) {
            if (usedEnum.code.equals(code)) {
                return usedEnum.getMessage();
            }
        }
        return null;
    }

}
